<template>
    <vue-office-pdf :src="pdf" @rendered="renderedHandler" @error="errorHandler" />
</template>

<script>
//引入VueOfficePdf组件
import VueOfficePdf from '@vue-office/pdf'
export default {
    name: "VueOfficePdfDemo",
    components: {
        VueOfficePdf
    },
    data() {
        return {
            pdf: '/api/api/v1/download-shared-object/aHR0cDovLzEyNy4wLjAuMTo5MDAwL3Nlbmlvci12YWx2ZS1odWIvdHV0b3JpYWxzLyVFNyU5NCVCNSVFNSVBRCU5MCVFNSU4RiU5MSVFNyVBNSVBOC1GSCVFNSVCMCU4RiVFNyVBOCU4QiVFNSVCQSU4Ri5wZGY_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD00RzJLREJLVElKSlJWMU5UVTJMRyUyRjIwMjUwNTIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDUyM1QxMDM2NTZaJlgtQW16LUV4cGlyZXM9NDMxOTkmWC1BbXotU2VjdXJpdHktVG9rZW49ZXlKaGJHY2lPaUpJVXpVeE1pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmhZMk5sYzNOTFpYa2lPaUkwUnpKTFJFSkxWRWxLU2xKV01VNVVWVEpNUnlJc0ltVjRjQ0k2TVRjME9EQXpOakF5TVN3aWNHRnlaVzUwSWpvaWJXbHVhVzloWkcxcGJpSjkuM2xHbnVNU0tPTGQ0X1N2TXRpUHFIOG0zeldMN1MzeWpLakVMcjBQcldQei1KX2dNVFBNV2p2SnlZRGx3eDktaTFRZ2V6VXpLX1QteExGcjMxZkpJS0EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnZlcnNpb25JZD1udWxsJlgtQW16LVNpZ25hdHVyZT00ZmRkYjYwZjU3NmI2YjQwODgyMjc2MjRjNTMzOWYzYjQ5ZjZiNmM4ODAwMWNlMGYzYmQwNWNmNzU1MDc3ZWVi' //设置文档地址
        }
    },
    methods: {
        renderedHandler() {
            console.log("渲染完成")
        },
        errorHandler() {
            console.log("渲染失败")
        }
    }
};
</script>

<style scoped></style>